/**
 * BodyTemp
 * This class represents a patient's recorded body temperature (in fahrenheit)
 * Subclass of Vitals
 */
package docoffice.doss;
import java.util.logging.Logger;

/**
 * @author George Chi
 * @version  $Revision: 1.8 $
 */
public class BodyTemp extends Vitals {
	
	/**
	 * Field CONVERSIONFACTOR.
	 */
	public static final double CONVERSIONFACTOR = 0.55555;
	
	/**
	 * Field CONVERSIONCONSTANT
	 */
	public static final double CONVERSIONCONSTANT = 32;
	
	/**
	 * Field bodyTempFahr.
	 */
	public double bodyTempFahr;

	/**
	 * Field bodyTempCelsius.
	 */
	public double bodyTempCelsius;

	/**
	 * Field LOG.
	 */
	private static final Logger LOG = Logger.getLogger("BodyTemp");
	
	/**
	 * Constructor for BodyTemp.
	 * @param patientPulse int
	 * @param patientBodyTempFahr double
	 */
	public BodyTemp(int patientPulse, double patientBodyTempFahr) {
		super(patientPulse);
		setBodyTempFahr(patientBodyTempFahr);
	}

	/**
	 * Method convertToCelsius.
	 * @param fahr double
	
	 * @return double */
	public double convertToCelsius(double fahr) {
		LOG.entering("BodyTemp", "convertToCelsius");
		// C = (F - 32) * 5/9
		bodyTempCelsius = (fahr - CONVERSIONCONSTANT) * CONVERSIONFACTOR;
		LOG.exiting("BodyTemp", "convertToCelsius");
		return bodyTempCelsius;
	}

	/**
	 * Method getBodyTempFahr.
	
	 * @return double */
	public double getBodyTempFahr() {
		return bodyTempFahr;
	}

	/**
	 * Method setBodyTempFahr.
	 * @param bodyTempFahr double
	 */
	public final void setBodyTempFahr(double bodyTempFahr) {
		this.bodyTempFahr = bodyTempFahr;
	}

	/**
	 * Method getBodyTempCelsius.
	
	 * @return double */
	public double getBodyTempCelsius() {
		return bodyTempCelsius;
	}

	/**
	 * Method setBodyTempCelsius.
	 * @param bodyTempCelsius double
	 */
	public final void setBodyTempCelsius(double bodyTempCelsius) {
		this.bodyTempCelsius = bodyTempCelsius;
	}
	
}
